﻿@using Ext.Net
@using Ext.Net.MVC
@model SDSystem.Models.RegisterModel
@{
    ViewBag.Title = "Register";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Header
{

}
@section ToolbarSection{
    @Html.X().Button().Text("Register").ID("btnSave").Disabled(true).Icon(Icon.Disk).DirectEvents(de =>
                    {
                        de.Click.Url = Url.Action("Register");
                        de.Click.EventMask.ShowMask = true;
                        de.Click.FormID = "FormPanelRegister";
                    })
    @Html.X().Button().Text("Back").Icon(Icon.ArrowLeft).Margins("0 0 0 10").Listeners(ls => ls.Click.Handler = "parentAutoLoadControl.close();")
}

@Html.X().FormPanel().ID("FormPanelRegister").Title("Register").StyleSpec("position: fixed; z-index: 10;width: 100%;").Listeners(
    ls => ls.ValidityChange.Handler = "App.btnSave.setDisabled(!valid)").Items(
        Html.X().TextFieldFor(m => m.UserName).FieldLabel("UserName").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.Email).FieldLabel("Email").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.Password).InputType(Ext.Net.InputType.Password).FieldLabel("Password").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().TextFieldFor(m => m.ConfirmPassword).InputType(Ext.Net.InputType.Password).FieldLabel("ConfirmPassword").LabelWidth(130).Width(500).StyleSpec("margin: 30px;"),
        Html.X().ComboBox().ID("CBBRole").FieldLabel("Roles").Items(ViewBag.Roles).LabelWidth(130).Width(500).StyleSpec("margin: 30px;")
    )
